package com.atguigu;

import jakarta.annotation.PostConstruct;
//import org.mybatis.spring.annotation.MapperScan; //不是导入这个包, 而是tk的包 !!!
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import tk.mybatis.spring.annotation.MapperScan;

/**
 * @Author: shenhao
 * @CreatTime: 2024/10/4 11:24
 * @Version: 1.0
 */
@MapperScan("com.atguigu.mapper")
@SpringBootApplication
public class Main {
    public static void main(String[] args) {
        System.out.println("Hello world!");
        SpringApplication.run(Main.class, args);
    }

    @Autowired
    private ThreadPoolTaskExecutor threadPoolTaskExecutor;
    //该 PostConstruct 注释用于需要在完成依赖关系注入以执行任何初始化后执行的方法
    @PostConstruct
    public void getThreadPoolConfig(){
        System.out.println("*******测试threadPool getCorePoolSize:"+threadPoolTaskExecutor.getCorePoolSize());
        System.out.println("*******测试threadPool getMaxPoolSize:"+threadPoolTaskExecutor.getMaxPoolSize());
        System.out.println("*******测试threadPool getQueueCapacity:"+threadPoolTaskExecutor.getQueueCapacity());
        System.out.println("*******测试threadPool getKeepAliveSeconds:"+threadPoolTaskExecutor.getKeepAliveSeconds());
    }
}